package com.mayikt;

/**
 * @Author: maplefire
 * @Description: 客户端—新开一个线程执行耗时任务，执行完通知给主线程
 * @Date: 2022/09/03 17:21
 */

public class FutureClient {

    public Data request(final String requestData){
        final FutureData futureData = new FutureData();
        new Thread(new Runnable() {
            public void run() {
                // 阻塞
                RealData realData = new RealData(requestData);
                futureData.setRealData(realData);
            }
        }).start();
        return futureData;
    }
}
